package com.wqm.step.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wqm.step.pojo.IDCard;
import com.wqm.step.pojo.User;
import com.wqm.step.service.OneToOneService;

@Controller
public class OneToOneController {

	@Autowired
	private OneToOneService oneToOneService;

	@RequestMapping(value = "/saveoneToOne.action", method = RequestMethod.GET, produces = {
			"text/html;charset=UTF-8" })
	@ResponseBody
	public String saveoneToOne() {
		// 1.创建一个人
		User user = new User();
		user.setName("张龙");

		// 2.创建身份证号
		IDCard idcard = new IDCard();
		idcard.setCardNum("1234567890");
		oneToOneService.saveOneToOne(user, idcard);
		return "数据保存成功？ 看看吧";
	}
}
